#pragma once

#include "MockerInterface.h"
#include "FunctionCallRecord.h"

namespace MockItNow
{
	template<typename T>
	struct CopyArgument
	{
		static void Copy(const T&, const T&)
		{
		}
	};

	template<typename T>
	struct CopyArgument<const T&>
	{
		static void Copy(const T&, const T&)
		{
		}
	};

	template<typename T>
	struct CopyArgument<const T*>
	{
		static void Copy(const T*, const T*)
		{
		}
	};

	template<typename T>
	struct CopyArgument<T&>
	{
		static void Copy(T& argument, const T& value)
		{
			argument = value;
		}
	};

	template<typename T>
	struct CopyArgument<T*>
	{
		static void Copy(T* argument, const T* value)
		{
			*argument = *value;
		}
	};

	template<>
	struct CopyArgument<char*>
	{
		static void Copy(char* argument, const char* value)
		{
			strcpy(argument, value);
		}
	};

	template<>
	struct CopyArgument<void*>
	{
		static void Copy(void*, const void*)
		{
		}
	};

	#define REPLAY_ARGUMENT(Type, Name, Index) \
		record->ReplayArgument<Type>(Name); \
		if (record->HasArgumentReturnValue(Index)) \
			CopyArgument<Type>::Copy(Name, record->GetArgumentReturnValue<Type>(Index));

	template<typename R, typename A1>
	struct FreeFunctionReplayer1
	{
		static R ReplayMockedFunction(A1 argument1)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1>
	struct FreeFunctionReplayer1<void, A1>
	{
		static void ReplayMockedFunction(A1 argument1)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R>
	struct FreeFunctionReplayer1<R, void>
	{
		static R ReplayMockedFunction()
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<>
	struct FreeFunctionReplayer1<void, void>
	{
		static void ReplayMockedFunction()
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2>
	struct FreeFunctionReplayer2
	{
		static R ReplayMockedFunction(A1 argument1, A2 argument2)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2>
	struct FreeFunctionReplayer2<void, A1, A2>
	{
		static void ReplayMockedFunction(A1 argument1, A2 argument2)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3>
	struct FreeFunctionReplayer3
	{
		static R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3>
	struct FreeFunctionReplayer3<void, A1, A2, A3>
	{
		static void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4>
	struct FreeFunctionReplayer4
	{
		static R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4>
	struct FreeFunctionReplayer4<void, A1, A2, A3, A4>
	{
		static void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4, typename A5>
	struct FreeFunctionReplayer5
	{
		static R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4, typename A5>
	struct FreeFunctionReplayer5<void, A1, A2, A3, A4, A5>
	{
		static void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
	struct FreeFunctionReplayer6
	{
		static R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
	struct FreeFunctionReplayer6<void, A1, A2, A3, A4, A5, A6>
	{
		static void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
	struct FreeFunctionReplayer7
	{
		static R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
	struct FreeFunctionReplayer7<void, A1, A2, A3, A4, A5, A6, A7>
	{
		static void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
	struct FreeFunctionReplayer8
	{
		static R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7, A8 argument8)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			REPLAY_ARGUMENT(A8, argument8, 7);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
	struct FreeFunctionReplayer8<void, A1, A2, A3, A4, A5, A6, A7, A8>
	{
		static void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7, A8 argument8)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			REPLAY_ARGUMENT(A8, argument8, 7);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
	struct FreeFunctionReplayer9
	{
		static R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7, A8 argument8, A9 argument9)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			REPLAY_ARGUMENT(A8, argument8, 7);
			REPLAY_ARGUMENT(A9, argument9, 8);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
	struct FreeFunctionReplayer9<void, A1, A2, A3, A4, A5, A6, A7, A8, A9>
	{
		static void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7, A8 argument8, A9 argument9)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(0);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			REPLAY_ARGUMENT(A8, argument8, 7);
			REPLAY_ARGUMENT(A8, argument9, 8);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1>
	struct MemberFunctionReplayer1
	{
		R ReplayMockedFunction(A1 argument1)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1>
	struct MemberFunctionReplayer1<void, A1>
	{
		void ReplayMockedFunction(A1 argument1)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R>
	struct MemberFunctionReplayer1<R, void>
	{
		R ReplayMockedFunction()
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<>
	struct MemberFunctionReplayer1<void, void>
	{
		void ReplayMockedFunction()
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2>
	struct MemberFunctionReplayer2
	{
		R ReplayMockedFunction(A1 argument1, A2 argument2)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2>
	struct MemberFunctionReplayer2<void, A1, A2>
	{
		void ReplayMockedFunction(A1 argument1, A2 argument2)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3>
	struct MemberFunctionReplayer3
	{
		R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3>
	struct MemberFunctionReplayer3<void, A1, A2, A3>
	{
		void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4>
	struct MemberFunctionReplayer4
	{
		R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4>
	struct MemberFunctionReplayer4<void, A1, A2, A3, A4>
	{
		void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4, typename A5>
	struct MemberFunctionReplayer5
	{
		R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4, typename A5>
	struct MemberFunctionReplayer5<void, A1, A2, A3, A4, A5>
	{
		void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
	struct MemberFunctionReplayer6
	{
		R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
	struct MemberFunctionReplayer6<void, A1, A2, A3, A4, A5, A6>
	{
		void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
	struct MemberFunctionReplayer7
	{
		R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
	struct MemberFunctionReplayer7<void, A1, A2, A3, A4, A5, A6, A7>
	{
		void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
	struct MemberFunctionReplayer8
	{
		R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7, A8 argument8)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			REPLAY_ARGUMENT(A8, argument8, 7);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
	struct MemberFunctionReplayer8<void, A1, A2, A3, A4, A5, A6, A7, A8>
	{
		void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7, A8 argument8)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			REPLAY_ARGUMENT(A8, argument8, 7);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};

	template<typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
	struct MemberFunctionReplayer9
	{
		R ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7, A8 argument8, A9 argument9)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			REPLAY_ARGUMENT(A8, argument8, 7);
			REPLAY_ARGUMENT(A9, argument9, 8);
			record->Verify();
			record->ThrowExceptionIfSet();
			return record->GetReturnValue<R>();
		}
	};

	template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
	struct MemberFunctionReplayer9<void, A1, A2, A3, A4, A5, A6, A7, A8, A9>
	{
		void ReplayMockedFunction(A1 argument1, A2 argument2, A3 argument3, A4 argument4, A5 argument5, A6 argument6, A7 argument7, A8 argument8, A9 argument9)
		{
			FunctionCallRecord* record = MockerInterface::Instance().RegisterReplayFunctionCall(this);
			REPLAY_ARGUMENT(A1, argument1, 0);
			REPLAY_ARGUMENT(A2, argument2, 1);
			REPLAY_ARGUMENT(A3, argument3, 2);
			REPLAY_ARGUMENT(A4, argument4, 3);
			REPLAY_ARGUMENT(A5, argument5, 4);
			REPLAY_ARGUMENT(A6, argument6, 5);
			REPLAY_ARGUMENT(A7, argument7, 6);
			REPLAY_ARGUMENT(A8, argument8, 7);
			REPLAY_ARGUMENT(A9, argument9, 8);
			record->Verify();
			record->ThrowExceptionIfSet();
		}
	};
}
